<?php
include("../safe.php");
$perNumber=30;
$page=$_GET['page']; 

$search="";
$sql="select count(*) from ph_paylevel where 1=1";


$count=mysql_query($sql); 
$rs=mysql_fetch_array($count); 
$totalNumber=$rs[0];
$totalPage=ceil($totalNumber/$perNumber); 
if(!isset($page)){$page=1;} 
$startCount=($page-1)*$perNumber;
$sqls="select * from ph_paylevel where 1=1";
$sqls.=" order by id desc limit $startCount,$perNumber";
$result=mysql_query($sqls);
?> 
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<title>APP推广系统-充值比例配置</title>
<link href="../bootstrap/css/bootstrap.min.css" title="" rel="stylesheet" />
<link href="../css/mcommon.css" rel="stylesheet" title="" type="text/css" />
<link href="../css/style.css" rel="stylesheet" type="text/css"  />
<link rel="shortcut icon" href="/logo.ico" />

<script language="javascript">
<!--
function CheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
  {
  var e = form.elements[i];
  if (e.Name != "chkAll"&&e.disabled!=true)
  e.checked = form.chkAll.checked;
  }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>

<body>
<!--顶部-->
<?php include("../top.php");?> 
<!--顶部结束--->
<!--主体部分-->
<div class="down-main">
	<!--左侧部分-->
  <?php include("../left.php");?> 
  <!--左侧部分结束-->
  <!--右侧部分-->
  <div class="right-product right-full">
  	<!--右侧内容部分-->
    <div class="container-fluid right-product-con">
    	<div class="mianbaoxie"><i class="glyphicon-folder-open glyphicon"></i>
    		<span>APP推广系统</span>&gt;<span class="dangqian">充值比例</span></div>
      <div class="container-con">
      		<!--表格-->
      		<div class="tableCon">
			<div class="tableCon-tit clear">管理</div>
	      		<div class="tableCon-content">
				 
				<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" class="wenzi">
	<form id="form1" name="form1" method="post" action="order_save.php?action=del">
      <tr>
        <td bgcolor="#FFFFFF"><div align="center">序号</div></td>
        <td height="20" bgcolor="#FFFFFF"><div align="left">充值金额</div></td>
        <td bgcolor="#FFFFFF"><div align="left">到账金额</div></td>
         <td bgcolor="#FFFFFF"><div align="left">优惠比例</div></td>
      </tr>
  <?php while($row=mysql_fetch_array($result)){
    ?>
      <tr>
        <td bgcolor="#F7F7F7"><div align="center">
          <input name="id[]" type="checkbox" id="id[]" value="<?php echo $row["ID"];?>" />
        </div></td>
        <td bgcolor="#F7F7F7"><div align="left"><?php echo $row["amount"];?></div></td>
		<td bgcolor="#F7F7F7"><div align="left"><?php echo $row["realamount"];?></div></td>
 <td bgcolor="#F7F7F7"><div align="left"><?php echo $row["savelevel"];?>%</div></td>
      </tr>
	  
  <?php }?>
	  </td>
	  </tr>
	   
      <tr>
        <td bgcolor="#F7F7F7">
		</td>
        <td height="20" colspan="2" bgcolor="#F7F7F7"><div align="left">全选
          <input name="chkAll" type="checkbox" id="chkAll" onClick="CheckAll(this.form)" value="checkbox" /><input type="submit" class="btn btn-danger" value="删除选中"/>
		  <a class="btn btn-success" role="button" href="order_add.php">新增</a>
		  </div></td>
     </div></td>
      </tr>
      <tr>
        <td height="20" colspan="3" bgcolor="#F7F7F7"><div align="center"><?php if ($page != 1) { //页数不等于1?><a class="btn btn-primary btn-sm" role="button" href="?page=<?php echo $page - 1;echo $search;?>">上一页</a><?php }?> <!--显示上一页-->
          <?php if($page>=1+5){for($i=$page-5;$i<$page;$i++){  //循环显示出页面?><a class="btn btn-default btn-sm" role="button" href="?page=<?php echo $i;echo $search;?>"><?php echo $i ;?></a>
          <?php }}else{for($i=1;$i<$page;$i++){?><a class="btn btn-default btn-sm" role="button" href="?page=<?php echo $i;echo $search;?>"><?php echo $i ;?></a><?php }}?>
          <?php if($page>=$totalPage-5){for($i=$page;$i<=$totalPage;$i++){  //循环显示出页面?><a class="btn btn-default btn-sm" role="button" href="?page=<?php echo $i;echo $search;?>"><?php echo $i ;?></a>
          <?php }}else{for($i=$page;$i<=$page+5;$i++){?><a class="btn btn-default btn-sm" role="button" href="?page=<?php echo $i;echo $search;?>"><?php echo $i;?></a>
        <?php }}if ($page<$totalPage) { //如果page小于总页数,显示下一页链接?><a class="btn btn-default btn-sm" role="button" href="?page=<?php echo $page + 1;echo $search;?>">下一页</a><?php }?></div></td>
      </tr>
	  </form>
  </table>
   		</div>
	      	</div>
	      	<!--表格结束--->
      	</div>
      </div>
  </div>
	  <!--右侧内容部分结束-->
  </div>
  <!--右侧部分结束-->
</div>
<!--主体部分结束-->
<script src="../js/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="../bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../js/mcommon.js"></script>
</body>
</html>
